package.path = package.path .. ";./../../llib/?.lua";
--require("drw")
--require("toArray");
require("toType");
print(require("lSDL"));


--rect = cast(SDL_Rect());
if(false)then
    print(SDL_GetTicks());
    rect = cast(SDL_Rect());
    for i=0,10000000,1 do
        --dw(rect,0,4,dr(rect,0,4)+i);
        rect.x = rect.x + i;
    end
    print(dr(rect,0,4));
    print(SDL_GetTicks());
else
    rect = SDL_calloc(0x100,1);
    print(SDL_GetTicks());

    t = {
     __index =function(p,k)
        return dr(p,0,4);
     end,
     __newindex = function(p,k,v)
        return dw(p,0,4,v);
     end
    };

    udsetmetatable(rect,t);

    for i=0,10000000,1 do
        --dw(rect,0,4,dr(rect,0,4)+i);
        rect.x = rect.x + i;
    end
    print(dr(rect,0,4));
    print(SDL_GetTicks());
end
